#include <stdio.h>
#include <math.h>
#include "Point.h"

void polar(float x, float y, float* r, float* theta){
    *r = sqrt(x*x + y*y);
    *theta = atan2(y, x);
}

/**
 * File: TestPoint.c
 * ------------------
 * 编译：
 * gcc -o TestPoint TestPoint.c PointImpl.c
 */
int main(int argc, char **argv) {
    point a;
    point b;

    a.x = 1.0;
    a.y = 1.0;

    b.x = 4.0;
    b.y = 5.0;

    printf("%f\n", distance(a, b));

    float a2 = 0.0;
    float b2 = 0.0;
    polar(1.0, 1.0, &a2, &b2);
    printf("%f %f\n", a2, b2);
}